<script setup lang="ts">
import { onMounted } from 'vue';
import { RouterView } from 'vue-router'
const preventDefault = (event: Event) => {
  event.preventDefault();
};

const preventDefaultForScrollKeys = (event: KeyboardEvent) => {
  // Prevent scrolling for the following keys:
  // Space (32), Page Up (33), Page Down (34), End (35), Home (36),
  // Left (37), Up (38), Right (39), Down (40)
  const keys = [32, 33, 34, 35, 36, 37, 38, 39, 40];
  if (keys.includes(event.keyCode)) {
    preventDefault(event);
    return false;
  }
};

onMounted(() => {
  // Disable scroll for various events
  window.addEventListener('wheel', preventDefault, { passive: false });
  window.addEventListener('touchmove', preventDefault, { passive: false });
  window.addEventListener('keydown', preventDefaultForScrollKeys, { passive: false });
});

</script>

<template>

  <RouterView />

</template>

<style scoped>
#app {
  width: 100%;
  height: 100%;
}

.divheader {
  width: 100%;
  height: 6vh;
  position: sticky;
  top: 0px;
  z-index: 999;
}

.body {
  height: 94vh;
  min-width: 100%;
}
</style>
